package com.phonepn.mymall.goods.controller;

import com.phonepn.mymall.common.entity.Goods;
import com.phonepn.mymall.common.util.R;
import com.phonepn.mymall.goods.service.GoodsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 商品
 *
 * @author quifar
 */
@Slf4j
@RestController
@RequestMapping("/goods")
public class GoodsController {


    @Autowired
    private GoodsService goodsService;

    @GetMapping("/list")
    public R list() {
        List<Goods> list = goodsService.list();
        R r = new R();
        r.setData(list);
        return r;
    }

}
